
# 时间参数
ds=$1

# 采集数据
sqoop import \
--delete-target-dir \
--connect jdbc:mysql://cdh01:3306/business? \
--username business \
--password 'Business45345..' \
--query "select * from t_coupon_order where  \$CONDITIONS" \
--target-dir /daas/motl/bigdata01/ods/ods_t_coupon_order/ds=$ds \
--fields-terminated-by ',' \
-m 1


# 增加分区
hive -e "alter table bigdata01_ods.ods_t_coupon_order  add if not exists partition(ds='$ds');"
